package com.ytjj.qmyx.mall.service;

import com.ytjj.common.api.CommonResult;
import com.ytjj.common.model.UsersResponse;
import com.ytjj.qmyx.mall.model.HelpWork;
import com.ytjj.qmyx.mall.model.Product;
import com.ytjj.qmyx.mall.model.esmodel.ProductEsDto;
import com.ytjj.qmyx.mall.model.request.AddAssistOrderRequest;
import com.ytjj.qmyx.mall.model.request.EvaluationReleaseRequest;
import com.ytjj.qmyx.mall.model.request.RecommendRequest;
import com.ytjj.qmyx.mall.model.request.UserHelpRequest;
import com.ytjj.qmyx.mall.model.response.*;
import com.ytjj.qmyx.mall.model.vo.UserHelpWorkVo;
import com.ytjj.qmyx.users.model.UsersDto;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface EvaluationServive {

    Map<String,Object> selectHomeData(String type, Integer pageNum, Integer pageSize,UsersResponse currentUser);


    /**
     * 发布测评
     */
    DynamicResponse release(EvaluationReleaseRequest request);
    
    List<SpecialResponse> specialMallColumn();

    /**
     * 发布测评
     * @param request
     * @return
     */
    DynamicResponse releaseEvaluation(EvaluationReleaseRequest request);

    /**
     * 获取APP 我的购买列表
     * @param status
     * @param userId
     * @param pageNum
     * @param pageSize
     * @param allFlag null或者1-全部测评 2-未发布测评
     * @return
     */
    List<MyShoppingListResponse> getMyShopping(Integer status, Integer userId, Integer pageNum, Integer pageSize, Integer allFlag);

    /**
     * 根据动态id获取动态信息
     * @param dynamicId
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<DynamicEsResponse>  getDynamicInfo(Integer dynamicId, Integer pageNum, Integer pageSize);

    /**
     * 根据商品id获取测评商品详情
     * @param id
     * @return
     */
    EvaluationProductResponse getProductInfo(Integer id);

    /**
     * 获取商品所有规格
     *
     * @param productId
     * @return
     */
    List<EvaluationProductSpecResponse> getProductSpecList(Integer productId);

    /**
     * 根据品牌id查询品牌信息
     * @return
     */
    BrandDataResponse getBrandData(UsersResponse currentUser, Integer bankerId);

    Boolean selectIsFollow(Integer bankerId, Integer userId);

    List<EvaluationProductResponse> getBrandProductList(Integer bankerId, Integer bankerColumnId, Integer pageNum,
                                                        Integer pageSize, String productName, UsersResponse usersResponse);

    Map<String,Object> queryQualityProductList(Integer bankerId,UsersResponse usersResponse);

    List<EvaluationProductResponse> queryClearProductList(Integer bankerId, Integer pageNum,Integer pageSize);

    /**
     * 测评列表 （只查询0元测评商品的）
     * @param pageNum
     * @param pageSize
     * @param usersResponse
     * @return
     */
    List<EvaluationProductResponse> queryEvaluationProductList(Integer pageNum,Integer pageSize,UsersResponse usersResponse,Integer soldOut);

    /**
     * 关注/取消
     * @param bankerId
     */
    String updateBankerFollow(Integer bankerId, Integer userId);

    /**
     * 查询mall专区列表
     * @return
     */
    List<SpecialResponse> getSpecialList();

    /**
     * 查询app品牌列表里的专区
     * @return
     */
    List<SpecialResponse> getSpecialListByApp();

    /**
     * 根据专区id查询品牌列表
     * @param specialId
     * @return
     */
    List<BankerSiteInfoResponse> queryBankerListById(Integer specialId);

    List<BrandListResponse> getAppBrandPavilionList(Integer pageNum, Integer pageSize, Integer specialId);

    List<BrandListResponse> getAppBrandPavilionListNew(Integer pageNum, Integer pageSize, Integer specialId);

    BrandListResponse getAppBrandPavilionInfo(Integer pageNum, Integer pageSize, Integer id);

    List<DynamicResponse> getMyEvaluation(Integer userId, Integer pageNum, Integer pageSize,UsersResponse currentUser);

    /**
     * 新增助力单
     *
     * @param request
     */
    void addAssistOrder(AddAssistOrderRequest request);

    /**
     * 根据用户ID 查询助力单
     * @param userId
     * @return
     */
    AssistOrderResponse getAssistOrder(Integer userId);

    /**
     * app助力单状态在助力中时,并且库存为0时,将助力单状态变为失效
     * @param userId
     * @return
     */
    AssistOrderResponse getHelpWorkStatusWithStockZero(Integer userId);


    /**
     * ID 查询助力单
     * @return
     */
    AssistOrderResponse getShareAssistOrder(UsersResponse usersResponse, Integer id);

    /**
     * 用户助力
     * @param userHelpRequest
     * @return
     */
    HelpWorkResponse userHelp(UserHelpRequest userHelpRequest);

    /**
     * 用户协助助力
     * @param userHelpRequest
     * @return
     */
    String userAssistHelp(UserHelpRequest userHelpRequest,Integer type);

    int insertUserHelps(UserHelpRequest userHelpRequest);

    HelpWork selectHelps(Integer helpWorkId);
    /**
     * 获取我的关注 我的品牌
     *
     * @param type 1 我的关注 2我的品牌
     * @param userId
     * @return
             */
    FansBankerResponse getFansBanker(Integer type, Integer userId);

    Integer userHelpRequestList(UserHelpRequest userHelpRequest);

    int userHelpRequest(UserHelpRequest userHelpRequest);

    Integer userHelpa(UserHelpRequest userHelpRequest);

    HelpWork selectHelpId(Integer helpWorkId);

    /**
     * 获取我的关注列表
     *
     * @param userId
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<TrendsResponse> getFansFollowList(Integer userId, Integer pageNum, Integer pageSize);

    Integer getMyIdolNum(Integer userId);

    /**
     * 首页搜索
     *
     * 1产品 2用户 3品牌
     *
     * @param productId
     * @param productType
     * @param type
     * @param keyword
     * @param pageNum
     * @param pageSize
     * @return
     */
    HomePageResponse homePageSearch(Integer productId, Integer productType, Integer type, String keyword, Integer pageNum, Integer pageSize);

    /**
     * 加销量，减库存
     * @param productId
     * @param productSpecId
     * @param sum
     * @param productPrice
     */
    void sellAfter(Integer productId, Integer productSpecId, Integer sum, BigDecimal productPrice);

    /**
     * 查看该用户是否还在助力该商品
     * @param userId
     * @param evaluationId
     * @return
     */
    void cancelHelpWork(Integer userId, Integer evaluationId);

    /**
     * 查询首页 1热销2推荐3新品
     * @param pageNum
     * @param pageSize
     * @param type
     * @return
     */
    List<HomePageProductResponse> homePageTypeProduct(Integer pageNum, Integer pageSize, Integer type);

    /**
     * 我要点评列表
     * @param pageNum
     * @param pageSize
     * @param orderInfoId
     * @return
     */
    CommentInfoResponse commentInfo(Integer pageNum, Integer pageSize, Integer orderInfoId);

    /**
     * 推荐/不推荐
     * @param orderInfoId
     * @param isRecommend
     * @param tel
     */
    void recommend(Integer orderInfoId, Boolean isRecommend, Integer userId, String tel);

    /**
     * 测评专区列表
     * @return
     */
    List<SpecialResponse> specialColumn();

    /**
     * 测评首页
     * @param specialId
     * @param h5CurrentUser
     * @return
     */
    EvaHomeResponse evaluationHome(Integer specialId, Integer pageNum, Integer pageSize, UsersResponse h5CurrentUser,String type,String fileType,String platformData, Integer shuffle,String categoryId);

    List<EvaluationProductResponse> zeroProduct(Integer specialId,Integer pageNum,Integer pageSize,UsersResponse currentUser,Integer soldOut);

    List<UsersDto> querySelection(String type,Integer pageNum, Integer pageSize,UsersResponse currentUser);

    List<UsersDto> qualityUser(Integer pageNum, Integer pageSize,UsersResponse currentUser);

    List<DynamicResponse> searchDynamicData(String name,String type,String fileType, Integer pageNum, Integer pageSize,UsersResponse currentUser);

    List<Product> searchProductData(String name, Integer pageNum, Integer pageSize,Integer mark);

    List<UsersDto> searchUsersData(String name, Integer pageNum, Integer pageSize, Integer userId);

    void recommendAndStar(RecommendRequest recommendRequest, Integer userId, String tel);

    EvaluationDetailsResponse evaluationDetails(Integer dynamicId,Integer pageNum, UsersResponse user);

    EvaluationDetailsResponse sameEvaluation(Integer dynamicId, UsersResponse user, Integer pageNum, Integer pageSize);

    DynamicResponse releasePage(EvaluationReleaseRequest request);

    EvaluationDetailsResponse moreComment(Integer dynamicId, UsersResponse user, Integer pageNum, Integer pageSize);

    Object getForumLive(Integer id,String platformData);

    Object getForumLiveInfoList(Integer id, Integer pageNum, Integer pageSize,String platformData);

    Object getZeroEvaluationNum();

    List<ForumLiveInfoResponse> randomQueryLimit(int limit, String platformData);

    /**
     * 新增助力单
     *
     * @param request
     */
    CommonResult addAssistOrderId(AddAssistOrderRequest request);

    /**
     * 根据用户ID 查询助力单
     * @param userId
     * @return
     */
    List<AssistOrderResponse> getAssistOrderList(Integer userId);

}
